<?php

/**
 * bootstrap
 *
 * @author    Mon Zafra <monzee@gmail.com>
 * @package   Yano
 * @copyright (c)2009 Mon Zafra
 * @license   New BSD
 */

// add the parent directory of the Zend library to your include path first
Demo::run();

class Demo
{
    static protected $_initialized;

    static public function init()
    {
        date_default_timezone_set('Asia/Manila');
        error_reporting(E_ALL | E_STRICT);
        ini_set('display_startup_errors', 1);
        ini_set('display_errors', 1);

        require_once 'Zend/Loader.php';
        Zend_Loader::registerAutoLoad();

        $front = self::getFront();
        $front->setControllerDirectory('tests/app/controllers')
            ->throwExceptions(true)
            ->setParam('noErrorHandler', true)
            ->registerPlugin(new Yano_Template());

        self::$_initialized = true;
    }

    static public function getFront()
    {
        return Zend_Controller_Front::getInstance();
    }

    static public function run()
    {
        if (!self::$_initialized) {
            self::init();
        }
        return self::getFront()->dispatch();
    }

}
